// hyb_yl/mycenter/pages/cashCenter/cashCenter.js
var app = getApp()
var template = require('../../../../template/Twitter.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },
  cashing: function () {
    console.log("111");
    wx.navigateTo({
      url: '/hyb_yl/mycenter/pages/cashing/cashing',
    })
  },
  seecash: function () {
    wx.navigateTo({
      url: '/hyb_yl/mycenter/pages/cashRecord/cashRecord',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    template.tabbar("tabBar", 1, this)
    var id = wx.getStorageSync('mytkid')
    this.setData({
      id: id
    })
    //查询我的佣金
    var that = this
    app.util.request({
      'url': 'entry/wxapp/tuike.yongjin',
      data: {
        id: id
      },
      success: function (res) {
        console.log(res)
        that.setData({
          info: res.data
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var id = wx.getStorageSync('mytkid')
    //查询我的佣金
    var that = this
    app.util.request({
      'url': 'entry/wxapp/tuike.yongjin',
      data: {
        id: id
      },
      success: function (res) {
        console.log(res)
        that.setData({
          countmoney: res.data.countmoney
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})